UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jScP50aTwcPHWV5EfmQ7D//qGOKtU1z4cY3qwjJ57bU='
WHERE
key_id = '8458c2bd08269e715284fa844286224a2ebf3bc1e18a5caea73dc3bb92b94b61'
AND (
token = 'jScP50aTwcPHWV5EfmQ7D//qGOKtU1z4cY3qwjJ57bU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)