UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ppEUgq+1OniFmPUL9EhK3oFyzHokIAQYJakWoO8yAD4='
WHERE
key_id = '806c65d36939145b539e6563131b4cb046dc27ee80fce0845ba82932bf6e054d'
AND (
token = 'ppEUgq+1OniFmPUL9EhK3oFyzHokIAQYJakWoO8yAD4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)