UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IksXV0MzBJ/0DvQ/mrlKcVulsd6GhP7/IruKvmWuKBA='
WHERE
key_id = '661f25dedbd5a0e42a3fc6a1898bed2ea95c7388f1fddc9ad60f4b9c8ca46161'
AND (
token = 'IksXV0MzBJ/0DvQ/mrlKcVulsd6GhP7/IruKvmWuKBA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)