UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SRUQPbVdkRpiGPup2/Zzgqdwvy8E19E7vWdws1onyEI=' 
WHERE 
  key_id = 'cedb070e873056eece35c72e79dc7821e34417b9a1cb73937b2bab90b4bdac94' 
  AND (
    token = 'SRUQPbVdkRpiGPup2/Zzgqdwvy8E19E7vWdws1onyEI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050