UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fVv2e9vwBzoDCDVMiTeEyH8LvZXOwHRyZIgtknkleRg='
WHERE
key_id = '63ed3988c8c2712cec0ba6741ad72ebf8b83731ab519295250ee22fac0a0e9f7'
AND (
token = 'fVv2e9vwBzoDCDVMiTeEyH8LvZXOwHRyZIgtknkleRg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)