UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VCRJ1ah/oxVoGH0bebq6JDSWJx+ua0fJjV8SpIfpmmg=' 
WHERE 
  key_id = '856045cae51b89fc291770bf32c7cbdcd6e8757d180b888e8a536834da136de8' 
  AND (
    token = 'VCRJ1ah/oxVoGH0bebq6JDSWJx+ua0fJjV8SpIfpmmg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045