UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AtBi/+W51exS9tjaac+AcyNOb7HzQwCBJhAurXQUBt0='
WHERE
key_id = '81e6ba9883ecec919bd5375ca7ec7c5d94ebcf5a0188143922c6859976005922'
AND (
token = 'AtBi/+W51exS9tjaac+AcyNOb7HzQwCBJhAurXQUBt0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)