UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IDLTfT088rsIii0rCicDy6wF+rtU6oJiBwgLjOUYDYE='
WHERE
key_id = '046af18e799df13db75977c8e5c9e60e3112d30534e6b9e6bfdf0afccfb81d92'
AND (
token = 'IDLTfT088rsIii0rCicDy6wF+rtU6oJiBwgLjOUYDYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)