UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j6wGttiPs6H3LwCHmGGhAkvudyR2jzqgcOh/L+CwA7w='
WHERE
key_id = '2dcbbd4e6d99b45b832777672fbde030f12f3358210b3817f2efd9f789b29df4'
AND (
token = 'j6wGttiPs6H3LwCHmGGhAkvudyR2jzqgcOh/L+CwA7w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)