UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nvstGpAiOSXD5ZyICR/3CAbf2EI35qczSKds0fc9Sqs=' 
WHERE 
  key_id = 'eb55a6e7ff700e340457da0fd59f884b9a007f2e698edb873d1c16d1bed3ba56' 
  AND (
    token = 'nvstGpAiOSXD5ZyICR/3CAbf2EI35qczSKds0fc9Sqs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035