UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g6j9TGazWI/l2zY6JecOkbfKsSwQ+x3dpllysYlEb3s='
WHERE
key_id = '648578305e1a68f4a74d16855316f9e077f2acc0982351b9f7329626b73aea5d'
AND (
token = 'g6j9TGazWI/l2zY6JecOkbfKsSwQ+x3dpllysYlEb3s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)