UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '04Lar1gaZCS4X3xwMQR3H3p7SNGmajrH98PDNhwF9kQ=' 
WHERE 
  key_id = 'dc3c0010fed84fcd5fd8c7f5c35e1753688894a71cbc619ecc59805a630beaf6' 
  AND (
    token = '04Lar1gaZCS4X3xwMQR3H3p7SNGmajrH98PDNhwF9kQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026