UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5KsMMjQhC4ctOXiVuhl0uR9V7drmTSIBreINWivsgOA=' 
WHERE 
  key_id = '7924c170ec4b5cb956844c423582e4db02691e20a679f0c90124cecd0133190d' 
  AND (
    token = '5KsMMjQhC4ctOXiVuhl0uR9V7drmTSIBreINWivsgOA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044