UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VyFLmP6vDhL7494L9aFdPNPtUiR51HM2TijCpRxc9uo=' 
WHERE 
  key_id = 'c943f8555bd5fce19fe7d070e7bd59e4658fb965bca00cfa1aead3d3b36c2cb0' 
  AND (
    token = 'VyFLmP6vDhL7494L9aFdPNPtUiR51HM2TijCpRxc9uo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034