UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rst0nP/LJ4ex6tKjwDo+exYKY2uwlGueINWcxiq3IBo='
WHERE
key_id = '22539b91a0db564f37750d0d321a703af9531ececf5b08f930d6b6006c7d4cfa'
AND (
token = 'Rst0nP/LJ4ex6tKjwDo+exYKY2uwlGueINWcxiq3IBo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)