UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ObfY+T1f8yG20PSRJuETiffpEMcomfECRoGJCpY6sW0=' 
WHERE 
  key_id = 'be4c8ad29fc80321fec7c7af427665473129873f6bf9e0f3b982f3f65c01b898' 
  AND (
    token = 'ObfY+T1f8yG20PSRJuETiffpEMcomfECRoGJCpY6sW0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030