UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cvHgzKtpI9Qa8Oswl9/2lBUMS2gKpV6iGm9fLUcIwy0='
WHERE
key_id = 'fbe2ddb8d5d4d5bed0694f2ae4c488922d283015310dad07cdf3a54769fffe47'
AND (
token = 'cvHgzKtpI9Qa8Oswl9/2lBUMS2gKpV6iGm9fLUcIwy0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)