UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5iVVHW9oDJz4XVMJrGq4ypnWlOeq39LWCmIRbiSxi0g='
WHERE
key_id = '05ee35e179abd036e728a91ef27f5626542a5049b59fbb1981246543e7b95c90'
AND (
token = '5iVVHW9oDJz4XVMJrGq4ypnWlOeq39LWCmIRbiSxi0g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)