UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ySmvsI1brUbHL0SCTodEoALQXLrA4S8NPEJ0fOsUJWE=' 
WHERE 
  key_id = '910e4a692f123e856e421fbc79daba668f7787fcb643d5ba3c648e6c3ec3b29c' 
  AND (
    token = 'ySmvsI1brUbHL0SCTodEoALQXLrA4S8NPEJ0fOsUJWE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029