UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rE8ZW1sbWzexvy/zKxR+W1Dp5chTwMlalUmAQ/Un39I=' 
WHERE 
  key_id = 'ad4e80f70370c5eb18c9b4e00c9d766445043dd4d07d8a6a07396ac0b62e3b1a' 
  AND (
    token = 'rE8ZW1sbWzexvy/zKxR+W1Dp5chTwMlalUmAQ/Un39I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037