UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fXR3HUY/LV3pkANz1/Qop/e68BOAf52ev8tB4Dbhzh8=' 
WHERE 
  key_id = '464b81ad3ebf72738e3958101f2cd3ef1c8ca6d8df26a2273a40d2af9d0b3e7c' 
  AND (
    token = 'fXR3HUY/LV3pkANz1/Qop/e68BOAf52ev8tB4Dbhzh8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036