UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8MBWTB9TDZMIq6L715CUVrgOC5n9eJ4MhSe9ue/8QMs='
WHERE
key_id = '5175c18515215d828272d7c1fbf99c261c1e2ec2a45bac2951bc3acada1f075e'
AND (
token = '8MBWTB9TDZMIq6L715CUVrgOC5n9eJ4MhSe9ue/8QMs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)