UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lt19dHS6rDbXuqXY0MfeMsGD5sLXpUU1Y2nQqupdhcw=' 
WHERE 
  key_id = '9370eb91aae8d719071675b659f0574503c37f4e2fd691d49b7b305a64e72f42' 
  AND (
    token = 'Lt19dHS6rDbXuqXY0MfeMsGD5sLXpUU1Y2nQqupdhcw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050