UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hC5ZL/LX6UlVWa9dm/EcK5Dta8OR7d0IlYFhYbwILUI=' 
WHERE 
  key_id = '5ccf2b36c7a33aaaf7e60a308ac0eecaee3bdd23d31b1dd4d3a3eeaead6dfbef' 
  AND (
    token = 'hC5ZL/LX6UlVWa9dm/EcK5Dta8OR7d0IlYFhYbwILUI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052