UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8PRxFMuJ5lAsVS9KnjfQWTJeOLk/j9eCXx6sVL22auM='
WHERE
key_id = 'e2f5f6d8c0a4998ef3f3ad01dcad6f7db6faddc7a92f446f6e9d454d49dbf088'
AND (
token = '8PRxFMuJ5lAsVS9KnjfQWTJeOLk/j9eCXx6sVL22auM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)