UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0sXPHTgFA4RxaZZKu3UkuEeWXZbFU0ndzyBAI4ZZpvM='
WHERE
key_id = 'cfed155a5d31dda8e908c848694f8270b297fd796a8b7cb79e3cc9e5577f5a7b'
AND (
token = '0sXPHTgFA4RxaZZKu3UkuEeWXZbFU0ndzyBAI4ZZpvM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)