UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'csXbVGaq/dxckVM7SabX3IPN99YSLDkmNPdtSDY4Ufg=' 
WHERE 
  key_id = 'eb8ee23ee05954eeccd4e453279c77cefe026531d6ef2e3aa621607cda9dc4bf' 
  AND (
    token = 'csXbVGaq/dxckVM7SabX3IPN99YSLDkmNPdtSDY4Ufg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048