UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vk4G5SUMIwd4/saAABivvU4IVYMmMt8+E3n8aMqlqX0='
WHERE
key_id = '2ee7feb6ceafd41915a0786b5027d864072a59ebcff5c2955d44c62ea50027f9'
AND (
token = 'Vk4G5SUMIwd4/saAABivvU4IVYMmMt8+E3n8aMqlqX0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)