UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rmxl4W7/Zuw9z1xzdGo+fxGCHhi/7lddgdU/HVI+hk8=' 
WHERE 
  key_id = '03ae0d09b7481f6f11b2b6a77ff042d7a3d918f9cfe3a3e507546ddab0df963c' 
  AND (
    token = 'Rmxl4W7/Zuw9z1xzdGo+fxGCHhi/7lddgdU/HVI+hk8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028