UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SBskwp3PeE6JbI+vVrysRCP0AIywp2OJtQl6TE5icns=' 
WHERE 
  key_id = '025cb77e901cbd39051ae74580bcae346c06c8776ef220ab5bfe5d719a1c205e' 
  AND (
    token = 'SBskwp3PeE6JbI+vVrysRCP0AIywp2OJtQl6TE5icns=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044