UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '64rs7MvwUKW6DvfXWNl6eUqBfoAeA7YpJYYZvylUdpo='
WHERE
key_id = '2f60e3913a3925edf4f9e6adefb193ecbb2df1a1cc77cd29e907874bad13a55e'
AND (
token = '64rs7MvwUKW6DvfXWNl6eUqBfoAeA7YpJYYZvylUdpo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)