UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1BHPjOVMeOvNXxMiBK/FSRa9CkmyVwu8wnQUZjotTQ0='
WHERE
key_id = '8226dae8aec203309969307f35ea31e0cc19130efcb22ac6937ff2960a971c5e'
AND (
token = '1BHPjOVMeOvNXxMiBK/FSRa9CkmyVwu8wnQUZjotTQ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)