UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vidZ0dLv9cMAbMCjqVIqCciMMELCbcbyDTbP+hp3APw='
WHERE
key_id = 'cabcb0041ce321289f07c0f90d61f1af9a2936c9fcbbd199db0666b2e5c99082'
AND (
token = 'vidZ0dLv9cMAbMCjqVIqCciMMELCbcbyDTbP+hp3APw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)