UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fyQMuWqPNVSimPJm3vqg2KXyM6dOrktre/TRMJhlF2g=' 
WHERE 
  key_id = 'c4a2811b7a213a2f947362089460b1eed94f1923ea76110d00bbbccc23cbda90' 
  AND (
    token = 'fyQMuWqPNVSimPJm3vqg2KXyM6dOrktre/TRMJhlF2g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028