UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm62Zex0KgZavTLD6hJ9+nQrxPG1RZDyYfgWCvltZAYE=' 
WHERE 
  key_id = 'd12256fd418e1d6d4432f227dd206ad7f511f298adfb13b7ae4d9c061d1055bb' 
  AND (
    token = 'm62Zex0KgZavTLD6hJ9+nQrxPG1RZDyYfgWCvltZAYE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036