UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NEPtpWzsqcfKJ1qvtR8QJqU3G61MEOswnKroSQ3StZc='
WHERE
key_id = '0ab13fe226c14ff8ee128cb72364aeaaf7a459167afb93c9369620e32429c09b'
AND (
token = 'NEPtpWzsqcfKJ1qvtR8QJqU3G61MEOswnKroSQ3StZc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)